<template>
  <el-dialog
    :title="title"
    :visible.sync="visible"
    :destroy-on-close="close_modal_destroy"
    :close-on-click-modal="close_modal"
    @close="handleCancel"
    width="700px"
    append-to-body
  >
    <div v-html="this.context">
    </div>
    <comment :id="this.id" :type="0"></comment>
  </el-dialog>
</template>

<script>
import { getDetailShare} from "@/api/liveShare";
import comment from '@/components/soulListen/comment'
import AddComment from "@/components/lifesquare/addComment";
export default {
  name: "detailLifeShare",
  components:{
    AddComment,
    comment
  },
  data() {
    return {
      title: '生活点点滴滴',
      visible: false,
      close_modal_destroy: true,
      close_modal: false,
      id: undefined,
      context: undefined,
      commentNum: 0,
      textarea: '',
      headImage: '',
      data: []
    }
  },
  methods: {
    add(id) {
      this.id = id
      this.visible = true
      getDetailShare(this.id).then(res => {
        this.context = res.body.data
      })
    },
    close() {
      this.id = undefined
      this.$emit('close')
      this.visible = false
    },
    handleCancel() {
      this.close()
    }
  }
}
</script>

<style scoped>

</style>
